﻿@{
    ViewBag.Title = "User";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml";
}
@section Head
{
    <script src="@Url.Content("~/Areas/Admin/Scripts/Solution.Admin.SysUser.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Areas/Admin/Content/Solution.Admin.User.css")" rel="stylesheet" type="text/css" />

}
<script type="text/javascript">
    var Url = '@Url.Action("GetData")/';
    var UrlEdit = '@Url.Action("Edit")/';
    $(document).ready(function () {
        InitMenuID(2,0);
        Solution.Admin.Core.InitNotif();
        Solution.Admin.SysUser.CreateGrid(Url, UrlEdit);
    });

    function Create() {
        Solution.Admin.SysUser.DialogCreate();
    }
    function SubmitEditCreate() {
        Solution.Admin.SysUser.SubmitEditCreate('@Url.Action("SubmitEditCreate")');
    }
    function Cancel() {
        Solution.Admin.SysUser.Cancel();
    }
    function ReloadGrid() {
        Solution.Admin.SysUser.ReloadGrid()
    }
    function DeleteRows() {
        Solution.Admin.SysUser.DeleteRows(UrlEdit);
    }
    function DeleteRowsForever() {
        Solution.Admin.SysUser.DeleteRows(UrlEdit, true);
    }
    function ShowBin() {
        Solution.Admin.SysUser.ShowBin(Url,true);
    }
    function NotShowBin() {
        Solution.Admin.SysUser.ShowBin(Url,false);
    }
</script>
<h1>
    <img src="@Url.Content("~/Areas/Admin/Content/Images/icon/user_32x32.png")" alt="">
    User management
</h1>
<div id="InitNotif">
</div>
<div class="bloc">
    @* <div class="title"> User<a href="#" class="toggle"></a></div>*@
    <div class="content">
        <div class="nvbar">
            <input type="button" id="AddNew" value="Add new" class="white" onclick="Create();"/>
            <input type="button" id="ReLoad" value="Reload" class="white" onclick="ReloadGrid();"/>
            <input type="button" id="Delete" value="Delete" class="white" onclick="DeleteRows();"/>
            <input type="button" id="DeleteForever" value="Delete forever" class="white" onclick="DeleteRowsForever();"/>
            <input type="button" id="Normal" value="Normal" class="blue" onclick="NotShowBin();"/>
            <input type="button" id="ShowBin" value="Show bin" class="white" onclick="ShowBin();"/>
        </div>
        <div class="jqgrid">
            <table id="List" class="scroll" cellpadding="0" cellspacing="0">
            </table>
            <div id="ListPager" class="scroll" style="text-align: center;">
            </div>
        </div>
    </div>
</div>
<div id="field" style="display: none">
    <form id="fieldForm">
    <fieldset class="vertical" id="form-user">
        <legend>form</legend>
        <div>
            <div>
                <label class="col1">
                    ID</label></div>
            <div>
                <input class="col2" id="Id" type="text" value="" readonly="readonly" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    User Name</label></div>
            <div>
                <input class="col2" id="LoginName" type="text" value="" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    Email</label></div>
            <div>
                <input class="col2" id="Email" type="text" value="" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    Full Name</label></div>
            <div>
                <input class="col2" id="FullName" type="text" value="" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    PassWord</label></div>
            <div>
                <input class="col2" id="Password" type="password" value="" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    Sex</label></div>
            <div>
                <select id="Sex" class="col2">
                    <option value="Male">Male</option>
                    <option value="Female">Female</option>
                </select>
            </div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div>
            <div>
                <label class="col1">
                    Flag</label></div>
            <div>
                <input class="col2" id="flag" type="text" /></div>
            <div>
                <label class="col3 txtLeft marginLeft1 color1">
                </label>
            </div>
        </div>
        <div class="marginTop1">
            <div class="marginLeft2">
                <input id="btnSubmit" type="button" value="Submit" onclick="SubmitEditCreate();" /></div>
            <div>
                <input id="btnCancel" type="button" value="Cancel" onclick="Cancel();" /></div>
        </div>
    </fieldset>
    </form>
</div>
<div class="contextMenu" id="myMenu1" style="display: none">
    <ul style="width: 200px">
        <li id="add" attrUrl="@Url.Action("GetUserByID")"><span class="ui-icon ui-icon-plus"
            style="float: left"></span><span style="font-size: 11px; font-family: Verdana">Add Row</span>
        </li>
        <li id="edit"  attrUrl="@Url.Action("GetUserByID")"><span class="ui-icon ui-icon-pencil"
            style="float: left"></span><span style="font-size: 11px; font-family: Verdana">Edit
                Row</span> </li>
        <li id="del"  attrUrl="@Url.Action("GetUserByID")"><span class="ui-icon ui-icon-trash"
            style="float: left"></span><span style="font-size: 11px; font-family: Verdana">Delete
                Row</span> </li>
    </ul>
</div>
